import { createWebHistory, createRouter } from 'vue-router'


const router = createRouter({
    history: createWebHistory(),
    routes: [{
        path: '/',
        redirect: '/index',
        component: () =>
            import ('../page/index.vue'),
        meta: { title: '首页' },
        children: [{
                path: '/index',
                name: 'index',
                component: () =>
                    import ('../page/subpage/index.vue'),
                meta: { title: '首页' },
            },
            {
                path: '/category',
                name: 'category',
                component: () =>
                    import ('../page/subpage/category.vue'),
                meta: { title: '分类管理' },
            },
            {
                path: '/goods',
                name: 'goods',
                component: () =>
                    import ('../page/subpage/goods.vue')
            }, {
                path: '/setting',
                name: 'setting',
                component: () =>
                    import ('../page/subpage/setting.vue')
            }
        ]
    }, {
        path: '/login',
        name: 'login',
        component: () =>
            import ('../page/login.vue'),
        meta: { title: '登录' },
    }]
})
export default router